package base.day12;

import org.w3c.dom.Text;

import java.util.ArrayList;
import java.util.Objects;
import java.util.Scanner;

public class Removelist {
    public static void main(String[] args) {
        //创建集合
        ArrayList<String> al=new ArrayList();
        for (int i = 0; i < 3; i++) {
            //键盘录入
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入：");
            String n = sc.nextLine();
            //添加进集合
            al.add(n);
        }
        System.out.println(al);
        for (int i = 0; i < al.size(); i++) {
            if ("text".equals(al.get(i))) {
                al.remove(i);
                i--;

            }
        }
        System.out.println(al);
    }
}
